# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.CSS.V1.Model.ItemLevelIssue do
  @moduledoc """
  The ItemLevelIssue of the product status.

  ## Attributes

  *   `applicableCountries` (*type:* `list(String.t)`, *default:* `nil`) - List of country codes (ISO 3166-1 alpha-2) where issue applies to the aggregate offer.
  *   `attribute` (*type:* `String.t`, *default:* `nil`) - The attribute's name, if the issue is caused by a single attribute.
  *   `code` (*type:* `String.t`, *default:* `nil`) - The error code of the issue.
  *   `description` (*type:* `String.t`, *default:* `nil`) - A short issue description in English.
  *   `destination` (*type:* `String.t`, *default:* `nil`) - The destination the issue applies to.
  *   `detail` (*type:* `String.t`, *default:* `nil`) - A detailed issue description in English.
  *   `documentation` (*type:* `String.t`, *default:* `nil`) - The URL of a web page to help with resolving this issue.
  *   `resolution` (*type:* `String.t`, *default:* `nil`) - Whether the issue can be resolved by the merchant.
  *   `servability` (*type:* `String.t`, *default:* `nil`) - How this issue affects serving of the aggregate offer.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :applicableCountries => list(String.t()) | nil,
          :attribute => String.t() | nil,
          :code => String.t() | nil,
          :description => String.t() | nil,
          :destination => String.t() | nil,
          :detail => String.t() | nil,
          :documentation => String.t() | nil,
          :resolution => String.t() | nil,
          :servability => String.t() | nil
        }

  field(:applicableCountries, type: :list)
  field(:attribute)
  field(:code)
  field(:description)
  field(:destination)
  field(:detail)
  field(:documentation)
  field(:resolution)
  field(:servability)
end

defimpl Poison.Decoder, for: GoogleApi.CSS.V1.Model.ItemLevelIssue do
  def decode(value, options) do
    GoogleApi.CSS.V1.Model.ItemLevelIssue.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.CSS.V1.Model.ItemLevelIssue do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
